<?php 
class AmazonECSComponent extends Object	{
	var $name = "AmazonECS";
	//Amazon API Public Key
	private $publicId = "AKIAJQGYEXPKSCJQVC6A";
	//Amazon API Private Key
	private $privateId = "hy0ZCM7iPtp6pNdIL0w5fNgFMhDX81eyD/HdYiWq";
	//Amazon Associates ID
	private $amazonId = "noegif-20";
	
	function startup(&$controller)
	{
		$this->controller = $controller;
		APP::import('Vendor', 'amzlib/amazonecs');
	}
	
	function getProductDetail($asin) {
		try
		{
			$amazonEcs = new AmazonECS($this->publicId, $this->privateId, 'COM', $this->amazonId);


			$amazonEcs->associateTag($this->amazonId);
			
			// Looking up multiple items

			$response = $amazonEcs->responseGroup('Large')->lookup($asin);
			return $response;
		}
		catch(Exception $e)
		{
		  echo $e->getMessage();
		}
	}
}
?>